<template>
	<div class="container">
		<ul>
			<li class="list-info-view-childen" v-for="(row, index) in PremisesGroupByCityList" :key="index">
				<div class="import-title">{{row.cityName}}</div>
				<ul>
					<li class="view-childen-list" v-for="(row1, index) in row.preGroupByCityList" :key="index" v-bind:tId="row1.premisesId"  @click="decisionPremises(row1.premisesId,row1.premisesName,row1.specialTime ,row1.specialTimeType,row1.protectTime,row1.protectTimeType,row1.reportProtect,row1.reportProtectType,row1.reportWay)">{{row1.premisesName}}</li>
				</ul>
			</li>
		</ul>
	</div>
</template>
<script>
	export default{
		data(){
			return {
				PremisesGroupByCityList:[]
			}
		},
		components: {
		},
		mounted: function() {
	       this.initPremisesInfo();
		}, 
		methods:{
			initPremisesInfo:function(){
				var url = this.utilHelper.apiUrl+'/api/getPremisesGroupByCity.do';
				var body = {};
				body.params = {};
				this.$http.post(url,body).then((response)=>{
					var body = response.body;
					if(body.result==1){
						this.PremisesGroupByCityList = body.resData.list;
					}else{
						layer.msg("数据获取失败");
					}
					
				});
			},
			decisionPremises(tid,tName,specialTime, specialTimeType,protectTime,protectTimeType,reportProtect, reportProtectType, reportWay){
				this.$router.push({
					name: 'addCustomer', 
					params: {
						id: tid,
						name: tName,
						spec: 1,
						specialTime: specialTime,
						specialTimeType: specialTimeType,
						protectTime: protectTime,
						protectTimeType: protectTimeType,
						reportProtect: reportProtect,
						reportProtectType: reportProtectType,
						reportWay:reportWay
					}})
			}
		}
	}
</script>